package models

import (
	"atcle/conf/config"
	"io"
	"mime/multipart"
	"os"
)

func Getimage(f multipart.File, m *multipart.FileHeader, err error) string {
	if err != nil {
		return "http://" + config.Config.Mysql.Port + ":8080/static/img/屏幕截图 2024-08-22 110505.png"
	}
	file, _ := os.OpenFile("./static/img/"+m.Filename, os.O_RDWR|os.O_CREATE|os.O_APPEND, 777)
	io.Copy(file, f)
	return "http://" + config.Config.Mysql.Port + ":8080/static/img/" + m.Filename
}
